package com.isoft.systemprovidor.controller.perinfor;

import com.isoft.systemprovidor.bean.ResponseData;
import com.isoft.systemprovidor.controller.BaseController;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Relative_Familynember;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Relative_Relocation;
import com.isoft.systemprovidor.service.perinfor.Perinfor_Relative_Relocation_Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemprovidor/relocation")
public class Perinfor_Relative_Relocation_Controller extends BaseController {
    @Autowired
    Perinfor_Relative_Relocation_Service service;
    /*查看家庭成员的移居信息*/
    @GetMapping("/get")
    public ResponseData selectRelocation(String sysuserid){
        return service.selectRelocation(sysuserid);
    }

    /*修改家庭成员的移居信息*/
    @PutMapping("/update")
    public ResponseData<Boolean> changeRelocation( @RequestBody Perinfor_Relative_Relocation relocation){
        return returnBoolean(service.changeRelocation(relocation));
    }
    /*插入家庭成员的移居信息*/
    @PostMapping("/add")
    public ResponseData<Object> insertRelocation(Perinfor_Relative_Relocation relocation){
        return returnObject(service.insertRelocation(relocation));
    }
    /*删除家庭成员的移居信息(逻辑删除)*/
    @GetMapping("/islock")
    public ResponseData<Boolean> islockRelocation(Integer id ,String sysuserid){
        return returnBoolean(service.islockRelocation(id , sysuserid));
    }
}
